package com.cat.net.network.kafka.serializer;

import io.netty.buffer.ByteBuf;
import org.apache.kafka.common.serialization.Serializer;

/**
 * kafka流序列化器
 */
public class KafkaStreamSerializer implements Serializer<ByteBuf> {

    @Override
    public byte[] serialize(String s, ByteBuf byteBuf) {
        int length = byteBuf.readableBytes();
        byte[] data = new byte[length];
        byteBuf.readBytes(data);
        return data;
    }

}
